package stephencarmody.random_rotating_triangles;

import stephencarmody.k8.core.Application;
import stephencarmody.k8.core.Log;
import stephencarmody.k8.core.Texture;

public final class Main {

	public static TriangleFeeder feeder;
	public static Texture wood;
	
    /** Application entrypoint */
    public static void main(String[] args) {
    	try {
    		Log.setLogFile("C:/random_rotating_triangles.log");
    		Application.setTitle("k8 Test");
    		Application.initialise();
    		wood = new Texture("/stephencarmody/random_rotating_triangles/texture/blonde-wood.jpg");
    		new User();
    		new HUD();
    		feeder = new TriangleFeeder();
    		Application.run();
    	} catch ( Throwable t ) {
    		String msg = t.toString() + "\n\t";
    		StackTraceElement[] stack = t.getStackTrace();
    		for ( StackTraceElement s : stack ) msg += "at " + s.getClassName() + "." + s.getMethodName()+ "\n\t";
    		Log.severe("");
    		Log.severe("----");
    		Log.severe(msg);
    	} finally {
    		Application.destroy();
    	}
    }
    
}